package org.budo.support.java.awt.robot;

import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.io.OutputStream;

/**
 * @author limingwei
 * 
 * @see BudoImageImpl
 * @see BudoSubImageImpl
 * @see net.sourceforge.tess4j.util.ImageHelper
 */
public interface BudoImage {
    int width();

    int height();

    int rgb(int x, int y);

    int rgbMax();

    int rgbMin();

    BudoImage copy();

    /**
     * 多次调用返回同一个
     */
    BudoGraphics graphics();

    BudoImage colorRandom();

    BudoImage drawRect(int x, int y, int w, int h);

    BudoImage drawRect(Rectangle rectangle);

    BudoImage drawString(String text, int x, int y);

    BudoImage drawString(String text);

    BudoImage drawCross(int x, int y);

    BudoImage colorRange(int x, int y, int w, int h);

    BudoImage drawImage(BudoImage image, int x, int y);

    /**
     * 截图
     */
    BudoImage subImage(Rectangle rectangle);

    BudoImage subImage(int x, int y, int w, int h);

    /**
     * 将图像纵向切条
     */
    BudoImage subImageVertical(int x, int w);

    /**
     * 转成png
     */
    byte[] toPng();

    void toPng(OutputStream outputStream);

    BufferedImage getBufferedImage();

    BudoImage fillRect();

    BudoImage orange();

    BudoImage pink();
}